package LuceneIndexCreate.http;


import java.io.IOException;
import java.io.InputStream;

/**
 * Created by User on 2017/12/9.
 */
public class Cookie {
    private static String cookie;

    public static String getCookie() {
        return cookie;
    }

    public synchronized static void setCookie() throws IOException {
        InputStream resourceAsStream = Cookie.class.getClassLoader().getResourceAsStream("luceneIndexCreate/cookie");
        byte[] bs = new byte[10240];
        int read = resourceAsStream.read(bs);
        String s = new String(bs);
        System.out.println("设置cookie成功 " + s);

        Cookie.cookie = s;
    }

    public static void main(String[] args) throws IOException {
        setCookie();
        System.out.println(cookie);
    }
}
